package day;

import java.util.Arrays;

public class P1894 {
    public int chalkReplacer(int[] chalk, int k) {
        long sum = Arrays.stream(chalk).mapToLong(s -> (long) s).sum();
        long left = k % sum;
        int idx = 0;
        while ((left -= chalk[idx++]) >= 0) {

        }
        return idx;
    }

    public static void main(String[] args) {
    }
}
